import { defineStore } from "pinia";
import { Names } from "../../store-namespace";
import { _get, _post, _put, _delete, http } from "@/utils/axios";
import { SupplierChain } from "@/api/backend/index";

export const useSupplierChain = defineStore(Names.SupplierChain, {
  state: () => {
    return {
      type: [],
    };
  },
  getters: {},
  actions: {
    //获取供应链数据信息
    getChain(filter: any) {
      return new Promise((resolve, reject) => {
        _get(SupplierChain + "/list", filter, "json", "")
          .then((res) => {
            console.log(res);
            resolve(res);
          })
          .catch((err) => {
            console.log(err);
            reject(err);
          });
      });
    },
  },
});
